<script type="text/javascript">
$(function(){
$('#supplier-dg').edatagrid({
    url: 'Supplier/supplier_list',  
    saveUrl: 'Supplier/supplier_save',  
    updateUrl: 'Supplier/supplier_update',  
    destroyUrl: 'Supplier/supplier_destroy',
    fit: true,
    fitColumns: true,
    rownumbers: true,
    border: false,
    pagination: true,
    idField: 'id',
    pageSize: 20,
    pageList: [20, 40, 60, 80, 100],
    sortName: 'createdatetime',
    sortOrder: 'desc',
    checkOnSelect: false,
    selectOnCheck: false,
    nowrap: false,
    columns: [[{
        title: '名称',
        field: 'name',
        width: 200,
        editor: 'text'
    },
    {
        title: '地址',
        field: 'address',
        width: 320,
        editor: 'text'
    },
    {
        title: '固定电话',
        field: 'tel',
        width: 100,
        editor: 'text'
    },
    {
        title: '手机号码',
        field: 'mobile',
        width: 80,
        editor: 'text'
    },
    {
        title: 'QQ号码',
        field: 'qq',
        width: 70,
        editor: 'text',
        formatter: function(qq) {
            return "<a target='_blank' href='http://wpa.qq.com/msgrd?v=3&uin=" + qq + "&site=qq&menu=yes'>" + qq + "</a>";
        }
    },
    {
        title: '旺旺',
        field: 'stock',
        width: 60,
        editor: 'text'
    }]],
    toolbar: '#supplier-toolbar'
});
})
</script>
<table id="supplier-dg">
</table>
<div id="supplier-toolbar"> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onClick="javascript:$('#supplier-dg').edatagrid('addRow')">新增</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onClick="javascript:$('#supplier-dg').edatagrid('destroyRow')">删除</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#supplier-dg').edatagrid('saveRow')">保存</a> <a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#supplier-dg').edatagrid('cancelRow')">取消</a>  </div>